// Service Implementation
package com.ruoyi.candidateType.service.impl;

import com.ruoyi.candidateType.domain.ExamCandidateType;
import com.ruoyi.candidateType.mapper.ExamCandidateTypeMapper;
import com.ruoyi.candidateType.service.IExamCandidateTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
import java.util.Arrays;

@Service
public class ExamCandidateTypeServiceImpl implements IExamCandidateTypeService {

    @Autowired
    private ExamCandidateTypeMapper candidateTypeMapper;

    @Override
    public ExamCandidateType selectCandidateTypeById(Long id) {
        return candidateTypeMapper.selectCandidateTypeById(id);
    }

    @Override
    public List<ExamCandidateType> selectCandidateTypeList() {
        return candidateTypeMapper.selectCandidateTypeList();
    }

    @Override
    public int insertCandidateType(ExamCandidateType candidateType) {
        return candidateTypeMapper.insertCandidateType(candidateType);
    }

    @Override
    public int updateCandidateType(ExamCandidateType candidateType) {
        return candidateTypeMapper.updateCandidateType(candidateType);
    }

    @Override
    public int deleteCandidateTypeByIds(Long[] ids) {
        String idStr = Arrays.stream(ids).map(String::valueOf).collect(Collectors.joining(","));
        return candidateTypeMapper.deleteCandidateTypeByIds(idStr);
    }
}
